<%namespace name="mns_us" file="usersite_bits.html"/>
<%inherit file="_base1col.html"/>


<%def name="title()">User Activities </%def>




<div id="content" >
    <div class="bar1">
        <h3>Activities for User ?? Page</h3>
    </div>
    <div class="yui-g">
        <div class="yui-u first">
            <div class="box box2">
                <h3 style="">Recent Activities</h3>
                % if c.person:
                    ${mns_us.activities(c.person)}
                % else:
                    why not?
                % endif
            </div>
            <div class="box boxc">
                <h3>Top Activities</h3>
                <style type="text/css" media="screen"> 
                    .ds-comment-event {background-color: #E4F2FD;margin:8px;} 
                    .ds-comment-odd {background-color: #ccc;margin:8px;} 
                </style>
                % for a in c.activities:
                    <div class="${h.cycle("ds-comment-event", "ds-comment-odd") }">
                    ${a[0]}: ${a[1]} 
                    </div>
                % endfor
            </div>
        </div>
        <div class="yui-u">
            <div class="box box2">
                <h3 style="">Activity by Day</h3>
                % if c.person:
                    ${mns_us.activity_graph(c.person, c.activities_by_day,false)}
                % else:
                    no person?
                %endif
            </div>
            <div class="box boxc">
                <h3>Categories</h3>

                % if c.categories and len(c.categories) > 0:
                <script type="text/javascript">
                    google.load("visualization", "1", {packages:["imagepiechart"]});
                    google.setOnLoadCallback(function () {
                    <%
                    activityct = 0
                    %>
                    var data = new google.visualization.DataTable();
                    data.addColumn('string', 'Category');
                    data.addColumn('number', 'Number of Activities per Category');
                    data.addRows(${len(c.categories)});
                    % for a in c.categories:
                        data.setValue(${activityct}, 0, '${a[1]}');
                        data.setValue(${activityct}, 1, ${a[0]});
                        <%
                        activityct += 1
                        %>
                    % endfor

                    var chart = new google.visualization.ImagePieChart(document.getElementById('activity_by_category_div'));
                    chart.draw(data, {width: 400, height: 240,is3D: false, title: 'User Activities by Category'});
                    });
                </script>
                % endif
                <div id="activity_by_category_div" style="width: 400px; height: 240px;"></div>
            </div>
        </div>
    </div>
</div>

